#include <sstream>
#include "igslib_irtc_timer.h"
#include "igslib_iutil.h"

extern "C"
{
    using namespace igslib;
    static IRTCTimer* rtc_timer = GetRTCTimerManagerInstance()->NewM01RTCTimer();
    std::string time_str;
    std::string igslib_revision(util::GetRevision());

    const char* project_get_time_string()
    {
        std::stringstream ss;
        struct tm now_time = rtc_timer->GetTime();
        ss << "now: " << now_time.tm_year;
        ss << "/" << now_time.tm_mon;
        ss << "/" << now_time.tm_mday;
        ss << "," << now_time.tm_hour;
        ss << ":" << now_time.tm_min;
        ss << ":" << now_time.tm_sec;
        time_str = ss.str();
        return time_str.c_str();
    }

    const char* project_get_igslib_revision()
    {
        return igslib_revision.c_str();
    }
};
